package cn.leaf.uc.service.service.impl;

import cn.leaf.uc.api.entity.UserEntity;
import cn.leaf.uc.api.mapper.UserMapper;
import cn.leaf.uc.service.service.UserService;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public int register() {

        UserEntity entity = UserEntity.builder()
                .account("18888888888")
                .password("admin")
                .email("admin@twinkle-leaf.cn")
                .sex(NumberUtils.INTEGER_ZERO)
                .build();

        return userMapper.insert(entity);
    }
}
